//
//  HWWCREATEMANAGERViewController.m
//  HwwCreateManager
//
//  Created by 2297711051@qq.com on 03/07/2020.
//  Copyright (c) 2020 2297711051@qq.com. All rights reserved.
//

#import "HWWCREATEMANAGERViewController.h"
#import "HwwCreateManagerHeader.h"
#import "HWWCREATEMANAGERAppDelegate.h"
@interface HWWCREATEMANAGERViewController ()

@end

@implementation HWWCREATEMANAGERViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UILabel *testlb = [[UILabel alloc]init];
       [self.view addSubview:testlb];
       
       [testlb hww_createLabelWithManager:^(HwwCreateManager * _Nonnull manager) {
           manager.test(@"我是黄文武我是黄文武我是黄文武我是黄文武我是黄文武").testColor([UIColor redColor])
           .font([UIFont systemFontOfSize:16])
           .textAlignment(NSTextAlignmentLeft)
           .backgroundColor([UIColor greenColor])
           .borderWidth(1)
           .borderColor([UIColor blueColor])
           .frame(CGRectMake(100, 300, 200, 200))
           .shadowOffset(CGSizeMake(5, 5))
           .shadowColor([UIColor grayColor])
           .lineBreakMode(NSLineBreakByCharWrapping)
           .numberOfLines(0);
       }];
    
    UIImageView *testimageView = [[UIImageView alloc]init];
    [testimageView hww_createImageViewWithManager:^(HwwCreateManager * _Nonnull manager) {
        manager.image([UIImage imageNamed:@"icon_failure_hud"])
        .frame(CGRectMake(100, 600, 30, 30))
        .contentMode(UIViewContentModeScaleAspectFit)
        .userInteractionEnabled(YES)
        .gestures(self,@"buttonAction");
    }];
    
    [self.view addSubview:testimageView];
    
    UITextField *textfield = [[UITextField alloc]init];
    [textfield hww_createTextFieldWithManager:^(HwwCreateManager * _Nonnull manager) {
        manager.placeholder(@"123").testColor([UIColor redColor])
        .frame(CGRectMake(100, 100, 100, 30))
        .clearButtonMode(UITextFieldViewModeAlways)
        .borderStyle(UITextBorderStyleRoundedRect)
        .secureTextEntry(YES)
        .autocorrectionType(UITextAutocorrectionTypeYes)
        .keyboardType(UIKeyboardTypeNumberPad)
        .clearsOnBeginEditing(YES)
        .adjustsFontSizeToFitWidth(YES)
        .minimumFontSize(10)
        .returnKeyType(UIReturnKeySend)
        .keyboardAppearance(UIKeyboardAppearanceDark);
    }];
    
    [self.view addSubview:textfield];
    
    
    
    UIButton *button = [[UIButton alloc]init];
    [button hww_createButtonWithManager:^(HwwCreateManager * _Nonnull manager) {
        manager.backgroundColor([UIColor redColor])
        .title(@"232",UIControlStateNormal)
        .titlecolor([UIColor blackColor],UIControlStateNormal)
        .frame(CGRectMake(100, 300, 120, 40))
        .target(@"buttonAction123",[HWWCREATEMANAGERAppDelegate new],UIControlEventTouchUpInside);
    }];
    [self.view addSubview:button];
}

- (void)buttonAction
{
    NSLog(@"23r23r2r23r23r");
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}
@end
